package com.zqx.pojo;

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Stu entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "STU", schema = "AJWXJK", uniqueConstraints = @UniqueConstraint(columnNames = "SPH"))
@org.hibernate.annotations.Entity(dynamicInsert=true)
@SequenceGenerator(name="SEQ", sequenceName="TEST_SEQ",allocationSize=1)
public class Stu implements java.io.Serializable {

	// Fields

	private long stuid;
	private String sname;
	private int sage;
	private String sph;
	private Set<Laoxue> laoxues = new HashSet<Laoxue>(0);



	// Property accessors
	@Id
	@Column(name = "STUID", unique = true, nullable = false, precision = 22, scale = 0)
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ")
	public long getStuid() {
		return this.stuid;
	}

	public void setStuid(long stuid) {
		this.stuid = stuid;
	}

	@Column(name = "SNAME", length = 12)
	public String getSname() {
		return this.sname;
	}

	public void setSname(String sname) {
		this.sname = sname;
	}

	@Column(name = "SAGE", precision = 22, scale = 0)
	public int getSage() {
		return this.sage;
	}

	public void setSage(int sage) {
		this.sage = sage;
	}

	@Column(name = "SPH", unique = true, nullable = false, length = 32)
	public String getSph() {
		return this.sph;
	}

	public void setSph(String sph) {
		this.sph = sph;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY,mappedBy="stu")
	@JoinColumn(name="SPH")
	public Set<Laoxue> getLaoxues() {
		return laoxues;
	}

	public void setLaoxues(Set<Laoxue> laoxues) {
		this.laoxues = laoxues;
	}

	
}